using System.Collections;
using System.Collections.Generic;
using System;
using UnityEngine;
using PropSys;

public class StDodge : MovState
{
    private bool _isDashing;

    public StDodge(Action<StType> swcSt, MainCtrl mc) : base(swcSt, mc) { }

    public override void Enter()
    {
        _MC.PrepareMov();
        _MC.PlayAnim("Dodge");
        _MC.PfmCurMov();
        _isDashing = true;
    }

    public override void Exit()
    {
        _isDashing = false;
    }

    public override void LogicUpd()
    {
        if (_MC._curMovTimer-- <= 0)
        {
            if (_isDashing) SwcSt(StType.Dash);
            else SwcSt(StType.Idle);
        }
    }

    public override void CancelDash() { _isDashing = false; }
}
